﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using WMSADBUtility;

namespace WMSADL.Warehouse
{
    public class PD_LayoutUpdateDAL
    {
        public bool Update(int id, string filed, string values)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("UPDATE PD_Layout SET " + filed + "='" + values + "' WHERE NID='" + id + "' ");
            Database db = DatabaseFactory.CreateDatabase();
            using (DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()))
            {
                int rows = db.ExecuteNonQuery(dbCommand);
                if (rows > 0)
                    return true;
                else
                    return false;
            }
        }
    }
}
